package cn.edu.ctbu.bootstraptablepage.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j

public class HttpAspect {
    @Pointcut("execution(public * cn.edu.ctbu.bootstraptablepage.restcontroller.StudentRestController.*(..) )")
    public void log() {}
    @Before("log()")
    public void doBefore() {
        log.info("do before");
        System.out.println("111");
    }
    @After("log()")
    public void doAfter(){
        log.info("do after");
        System.out.println("222");
    }
    @AfterReturning(returning = "object",pointcut="log()")
    public void doAfterReturning(Object object) {
        log.info("response={}",object);
    }
}